package com.lqm.service.admin.impl;

import com.lqm.dao.AdminUserDao;
import com.lqm.entity.admin.AdminUser;
import com.lqm.service.admin.AdminUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

/**
 * @program: CrowdFunding
 * @description
 * @author: lqm
 * @create: 2018-12-04 20:54
 */
@Service
@Transactional
public class AdminUserServiceImpl implements AdminUserService {

    @Autowired
    AdminUserDao adminUserDao;


    @Override
    public AdminUser findAllByUsernameAndPassword(String username, String password) {
        return adminUserDao.findAllByUsernameAndPassword(username, password);
    }

    @Override
    public AdminUser findAllById(int id) {
        return adminUserDao.findById(id);
    }

    @Override
    public boolean save(AdminUser user) {
        AdminUser save = adminUserDao.save(user);
        return save==null?false:true;
    }

}
